<?php
define('APPLICATION_PATH')
    or define('APPLICATION_PATH',dirname(__FILE__));

define('APPLICATION_ENVIRONMENT')
    or define('APPLICATION_ENVIRONMENT','development');

$frontController = Zend_Controller_Front::getInstance();

$frontController->setControllerDirectory(APPLICATION_PATH . '/controllers');

$frontController->setParam('env',APPLICATION_ENVIRONMENT);

/* Set Config */
Zend_Registry::set('config',
        new Zend_Config_Ini(APPLICATION_PATH.'/config.ini', APPLICATION_ENVIRONMENT));

Zend_Layout::startMvc(APPLICATION_PATH . '/layouts/scritps');

/* BEGIN Define the doctype */
$view = Zend_Layout::getMvcInstance()->getView();
$view->doctype('HTML5');
/* END Define the doctype */

/* Add Path to helper */
$view->addHelperPath('App/View/Helper','App_View_Helper');
/* Add Path to helper */


/* Routes */
$router = $frontController->getRouter();

/*
$router->addRoute(
     'deleteItem',
     new Zend_Controller_Router_Route('/item/delete/:id', array('controller'=>'item','action'=>'delete'))
     );
$router->addRoute(
     'editItem',
     new Zend_Controller_Router_Route('/item/edit/:id', array('controller'=>'item','action'=>'edit'))
     );
*/
//Uno ambos Router en uno solo
$router->addRoute(
     'crudeItem',
     new Zend_Controller_Router_Route('/item/:action/:id', array('controller'=>'item','action'=>':action'))
     );

$router->addRoute(
     'listonIndex',
     new Zend_Controller_Router_Route('/list', array('controller'=>'index','action'=>'list'))
     );

$router->addRoute(
 'listonIndexWithUsers',
 new Zend_Controller_Router_Route('/list/:users', array('controller'=>'index','action'=>'list'))
 );
 /* Routes */

unset($frontController);
